package com.example.selenium.enums;

/**
 * 货物类型枚举类
 */
public enum  GoodsTypeEnum {

     CODE_90("90","电子产品"),
     CODE_92("92","商品汽车"),
     CODE_93("93","冷藏货物"),
     CODE_94("94","大宗货物"),
     CODE_95("95","快速消费品"),
     CODE_96("96","农产品"),
     CODE_999("999","其他");


     private String code;
     private String desc;


    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public String getDesc() {
        return desc;
    }

    public void setDesc(String desc) {
        this.desc = desc;
    }

    GoodsTypeEnum(String code, String desc){
         this.code = code;
         this.desc = desc;
     }

     public static String getDescByCode(String code){
         for (int i = 0; i < GoodsTypeEnum.values().length; i++) {
             if (GoodsTypeEnum.values()[i].getCode().equals(code)) {
                 return GoodsTypeEnum.values()[i].getDesc();
             }
         }
         return "";
     }
}
